package com.example.a79273.shandianban.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;


/**
 * Created by lenovo on 2016/8/29.
 */
public class YouHuo_TitlePagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> mData;
    private List<String> mTitles;
    public YouHuo_TitlePagerAdapter(FragmentManager fm, List<Fragment> mData,List<String> mTitles) {
        super(fm);
        this.mData = mData;
        this.mTitles = mTitles;
    }
    @Override
    public Fragment getItem(int position) {
        return mData.get(position);
    }

    @Override
    public int getCount() {
        return mData == null?0:mData.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles.get(position);
    }
}
